<template>
  <view class="car-images">
    <van-grid :square="true" column-num="3" :border="false">
      <van-grid-item v-for="item in imgs" :key="item" :use-slot="true">
        <image :src="item" @tap="() => preview(item)" mode="aspectFill" />
      </van-grid-item>
    </van-grid>
  </view>
</template>

<script>
import Taro from '@tarojs/taro'

export default {
  name: 'CircleImgs',
  props: {
    imgs: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {}
  },
  computed: {},
  methods: {
    preview(img) {
      Taro.previewImage({
        current: img,
        urls: this.imgs
      })
    }
  }
}
</script>

<style>
.car-images {
  margin-top: 24rpx;
}
.car-images image {
  width: 100%;
  height: 100%;
  border-radius: 6rpx;
}
</style>
